﻿#include "SpinBox.h"

#include <QWheelEvent>

SpinBox::SpinBox(QWidget *parent): QSpinBox(parent)
{
    setFocusPolicy(Qt::StrongFocus);
}


void SpinBox::wheelEvent(QWheelEvent *event)
{
    if (!hasFocus()) {
        event->ignore();
    } else {
        QSpinBox::wheelEvent(event);
    }
}

void SpinBox::mousePressEvent(QMouseEvent *event) {
    emit send_data(this->objectName(), QString::number(this->value()));
    QSpinBox::mousePressEvent(event);
}
